#*******************************************************************
#* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        *
#*                                                                 *
#*  NOTE      = 协议分析类库通用模块
#*  DATE      = 
#*******************************************************************

#共通参数
include         ./Makefile_comm.mk

#CC             = gcc
CFLAGS          = -fPIC

CFLAGS          += $(CFLAGS_EXT) `xml2-config --cflags`
CFLAGS          += $(CFLAGS_UTEST)

#-DFRREPORT_COMM_OLD_INTERFACE              使用老接口上报数据

INCLUDES        = -I. -I$(LIB_I_APM_COMM)
TARGET_LIB      = $(TARGET_LIB_APMMODULE)

SRC  = $(wildcard *.c)
OBJS = $(patsubst %.c, %.o, $(SRC))

all: $(TARGET_LIB) 

.c.o:$(OBJS)
	@$(CX) -c $(CFLAGS) $(INCLUDES)  $<

$(TARGET_LIB): $(OBJS)
	@$(AR) crv $@  $^
	@ranlib $@
	@rm -f *.o

prepare:
	echo -e "#ifndef __FRAUTOCFG_H_\n#define __FRAUTOCFG_H_\n\n" >  frautocfg.h
	echo -e "#define FRAME_MAJOR     \"$(COMM_FRAMEWORK_VER)\"\n" >> frautocfg.h
	echo -e "#endif\n\n" >>  frautocfg.h

clean:
	rm -f *.o *.a 

install:
	mkdir -p $(COMM_DIST_DIR_DEV_SO);mkdir -p $(LIB_I_APM_MODULE);
	cp $(TARGET_LIB) $(COMM_DIST_DIR_DEV_SO)/.
	cp *.h $(LIB_I_APM_MODULE)/.; cp Makefile_* *.sh $(LIB_I_APM_MODULE)/.

uninstall:
	rm -f $(LIB_A_APM_MODULE);rm -rf $(LIB_I_APM_MODULE)

# EOF
